<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.playitem{
	width: 990px;
	height: 150px;
	float: left;
	margin: 0 0 10px 0;
	position: relative;
	overflow:hidden;
	border: 5px outset rgb(188, 210, 233);
}
.play_avatar{
	width: 150px;
	height: 150px;
	float: left;
	margin :0 0 0 0;
	background-color: #FFFFFF;
	position: relative;
	text-align: center;
}
.play_detail{
	width: 720px;
	height: 150px;
	float: left;
	background-color: #EEEEEE;
	text-align:left;
	padding-left: 10px;
	position: relative;
}
.play_add{
	height: 150px;
	width: 100px;
	float: left;
	margin :auto auto;
	background-color: #EEEEEE;
	word-wrap: break-word;
	text-align: center;
	padding-left: 10px;
	position: relative;
}
</style>
<div style="text-align:left;margin-top:20px;">
	<c:forEach var="play" items="${page.items}"  varStatus="status">
		<div class="playitem">
			<div class="play_avatar">
				<img alt="${play.chineseName}" src="${ctx}/${play.images}"/>
			</div>
			<div class="play_detail">
				<a class="a2" href="<c:url value='/play/view.do?playId=${play.playId}'/>">
					<font style="font-size:15px;font-weight:bolder;color:#FF3333"><c:out value="${play.chineseName}"></c:out></font>
				</a>
				&nbsp;&nbsp;
				发表者：<c:out value="${play.publisher}"></c:out>
				<br/>
				<div style="word-wrap: break-word;margin-top:5px">
					<c:out value="${play.description}"></c:out>
				</div>
			</div>
			<div class="play_add">
				<a href="javascript:addShow(${play.playId})" class="a2">添加</a>
			</div>
		</div>
	</c:forEach>
</div>
<script>
function addShow(playid){
	var isLogin = '<c:out value="${isLogin}"/>';
	if(isLogin == 'false'){
		alert("请登录");
		return;
	}
	$.ajax({
		type : "POST",
		url : ctx + "/play/add.do",
		data : "playId="+playid,
		dataType:"xml", 
		timeout:20000,
		success : function(data){
			if($(data).find('result').text().toUpperCase().indexOf("TRUE") >= 0){
				alert("加入成功");
			}else{
				var value = $(result).find('content').text();
				alert(value);
			}
		},
		error: function(){
		}
	});
}
</script>